/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.controller;

import org.xstgongyi.eduaid.dataobject.SchoolYearDO;
import org.xstgongyi.eduaid.dataobject.SemesterDO;

/**
 * @author oldcrane<br/>
 * @created 2019-04-02
 */
class SemesterVO {

	private Integer id;
	private String name;
	private Integer schoolYearId;
	private String schoolYearName;
	private Boolean active;

	static SemesterVO of(SemesterDO semesterDO) {
		SemesterVO vo = new SemesterVO();
		vo.setId(semesterDO.getId());
		vo.setName(semesterDO.getName());
		vo.setSchoolYearId(semesterDO.getSchoolYearId());
		vo.setActive(semesterDO.getActive());
		return vo;
	}

	void addSchoolYearInfo(SchoolYearDO schoolYearDO) {
		if (null != schoolYearDO) {
			this.setSchoolYearName(schoolYearDO.getName());
		}
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getSchoolYearId() {
		return schoolYearId;
	}

	public void setSchoolYearId(Integer schoolYearId) {
		this.schoolYearId = schoolYearId;
	}

	public String getSchoolYearName() {
		return schoolYearName;
	}

	public void setSchoolYearName(String schoolYearName) {
		this.schoolYearName = schoolYearName;
	}

	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	@Override
	public String toString() {
		return "SemesterVO [id=" + id + ", name=" + name + ", schoolYearId=" + schoolYearId + ", schoolYearName="
				+ schoolYearName + ", active=" + active + "]";
	}

}
